import request from '@/utils/request'

export default {
  getAllActivity() {
    return request({
      url: `/weddingadmin/activity/getAll`,
      method: 'get'
    })
  },

  getActivityPageVo(current, limit) {
    return request({
      url: `/weddingadmin/activity/getActivityPageVo/${current}/${limit}`,
      method: 'get',
    })
  },

  getActivityPageQueryVo(current, limit, activityQuery){
    return request({
        url: `/weddingadmin/activity/getActivityPageQuery/${current}/${limit}`,
        method: 'post',
        data: activityQuery  //转化json传递
      })
  },

  deleteAllSelect(ids) {
    return request({
        url: `/weddingadmin/activity/deleteAllSelect`,
        method: 'delete',
        data: ids
    })
  },

  getOneById(id) {
    return request({
        url: `/weddingadmin/activity/getOneById/${id}`,
        method: 'get',
    })
  },
  
  deleteOneById(id) {
    return request({
        url: `/weddingadmin/activity/deleteOneById/${id}`,
        method: 'delete',
    })
  },

  finishActivity(id) {
    return request({
        url: `/weddingadmin/activity/finishActivity/${id}`,
        method: 'put'
    })
  },

  searchByName(activityName) {
    return request({
        url: `/weddingadmin/activity/searchByName/${activityName}`,
        method: 'get',
    })
  },

  saveOrUpdate(activity) {
    return request({
        url: `/weddingadmin/activity/saveOrUpdate`,
        method: 'post',
        data: activity,
    })
  },
}
